import nglview as nv
import Bio
from Bio import PDB, SeqIO, SeqUtils, Align
parser = PDB.PDBParser()
import warnings
from Bio import BiopythonWarning
warnings.simplefilter('ignore', BiopythonWarning)
prot = nv.show_file('data/3hpb.pdb')
prot
prot = nv.show_pdbid('3hpb')
prot
structure = parser.get_structure('7aiz', 'data/7aiz.pdb')
prot_struct = nv.show_biopython(structure)
prot_struct
from rdkit import Chem
from rdkit.Chem import AllChem
mol = Chem.MolFromSmiles('O[C@H]1[C@H](O)[C@@H](COP(O)(O)=O)OC(O)[C@@H]1O')
mol = Chem.AddHs(mol) # add H's
AllChem.EmbedMolecule(mol) # generate 3D structure
G6P = nv.show_rdkit(mol)
G6P
prot_3hpb = nv.show_file('data/3hpb.pdb')
prot_3hpb.clear_representations()
prot_3hpb.add_representation('ball+stick', selection='protein')
prot_3hpb
prot_3hpb = nv.show_file('data/3hpb.pdb')
prot_3hpb.clear_representations()
prot_3hpb.add_representation('licorice', selection='protein')
prot_3hpb
prot_1rpy = nv.show_file('data/3hpb.pdb')
prot_1rpy.add_representation('licorice', selection='sidechains')
prot_1rpy
prot_1rpy = nv.show_file('data/3hpb.pdb')
prot_1rpy.clear_representations()
prot_1rpy.add_representation('cartoon', color='hydrophobicity')
prot_1rpy
prot_1rpy = nv.show_file('data/3hpb.pdb')
prot_1rpy.add_representation('licorice', color='hydrophobicity')
prot_1rpy
prot_1rpy = nv.show_file('data/3hpb.pdb')
prot_1rpy.clear_representations()
prot_1rpy.add_representation('cartoon', color='sstruc')
prot_1rpy
prot_1rpy = nv.show_file('data/3hpb.pdb')
prot_1rpy.add_representation('licorice', color='resname')
prot_1rpy
full_surface = nv.show_biopython(structure)
full_surface.add_surface(opacity=0.3)
full_surface
acidic = nv.show_file('data/8pfy.cif')
acidic.clear_representations()
acidic.add_representation('licorice')
acidic.add_surface(selection='acidic',
opacity=0.4,
color='pink')
acidic
acidbase = nv.show_biopython(structure)
acidbase.clear_representations()
acidbase.add_representation('licorice')
acidbase.add_surface(selection=':B and backbone and (basic or acidic)',
opacity=0.3,
color='lightblue')
acidbase